package com.bluesky.ds;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

public class ReadWriteDataSource extends AbstractRoutingDataSource {

    @Override
    protected Object determineCurrentLookupKey() {
        //这里从ThreadLocal中获取路由的策略
        return ReadWriteRoutingStrategyHolder.getReadWriteRoutingStrategy();
    }
}

